<!-- include tpl=head_lay -->
<div class="hide" id="express_select_info">
<select id="code">
	<!-- loop from=$codelist key=$key value=$value -->
	<option value="{$value.id}">{$value.title}</option>
	<!-- /loop -->
</select>
</div>
<script type="text/javascript">
function add_it()
{
	var url = get_url('express','set');
	$.dialog({
		'title':"请选择快递接口引挈",
		'content':document.getElementById("express_select_info"),
		'ok':function(){
			var code = $("#code").val();
			if(!code){
				alert('请选择要创建的快递引挈');
				return false;
			}
			url += "&code="+code;
			$.phpok.go(url);
			return true;
		},
		'cancel':function(){},'cancelVal':'取消'
	});
}
function edit_it(id)
{
	$.phpok.go(get_url('express','set','id='+id));
}
function delete_it(id)
{
	var text = $("#title_"+id).text();
	$.dialog.confirm('确定要删除物流快递：<span class="red">'+text+'</span> 吗？',function(){
		var url = get_url('express','delete','id='+id);
		var rs = $.phpok.json(url);
		if(rs.status == 'ok'){
			$.phpok.reload();
		}else{
			$.dialog.alert(rs.content);
			return false;
		}
	});
}
</script>
<div class="layui-card">
	<div class="layui-card-header " style="visibility: visible;">
		<div>{lang物流管理}</div>
	</div>

	<div class="layui-card-body">

		<div class="layui-btn-group test-table-operate-btn" style="margin-bottom: 10px;">
			<button class="layui-btn" onclick="add_it();">
				<i class="layui-icon">&#xe608;</i> {lang添加物流}
			</button>
		</div>

		<table class="layui-table">
			<thead>
			<tr>
				<th>ID</th>
				<th>物流</th>
				<th>公司名称</th>
				<th>官方网站</th>
				<th>接口</th>
				<th>&nbsp;</th>
			</tr>
			</thead>
			<tbody>
			<!-- loop from=$rslist key=$key value=$value -->
			<tr>
				<td>{$value.id}</td>
				<td id="title_{$value.id}">{$value.title}</td>
				<td>{$value.company}</td>
				<td><a href="{$value.url}" target="_blank">{$value.homepage}</a></td>
				<td>{$codelist[$value.code][title]}</td>
				<td>
					<div class="layui-btn-group">
						<input type="button" value="{lang编辑}" onclick="edit_it('{$value.id}')" class="layui-btn layui-btn-sm" />
						<input type="button" value="{lang删除}" onclick="delete_it('{$value.id}')" class="layui-btn layui-btn-sm" />
					</div>
				</td>
			</tr>
			<!-- /loop -->
			</tbody>
		</table>
	</div>

</div>
<!-- include tpl=foot_lay -->